﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace GUI {
    public partial class frmRptBaoCaoCongNo : Form {
        private int _month;
        private int _year;

        public int Year {
            get {
                return _year;
            }
            set {
                _year = value;
            }
        }

        public int Month {
            get {
                return _month;
            }
            set {
                _month = value;
            }
        }
        public frmRptBaoCaoCongNo() {
            InitializeComponent();
        }

        private void frmRptBaoCaoCongNo_Load(object sender, EventArgs e) {
            rptBaoCaoCongNo rpt = new rptBaoCaoCongNo();
            CrystalDecisions.Shared.TableLogOnInfo tliCurrent;
           
            foreach (CrystalDecisions.CrystalReports.Engine.Table tbCurrent in rpt.Database.Tables) {
                tliCurrent = tbCurrent.LogOnInfo;
                tliCurrent.ConnectionInfo.ServerName = ".\\SQLEXPRESS";
                tliCurrent.ConnectionInfo.DatabaseName = "QuanLyNhaSach";
            }
            rpt.SetParameterValue("month", this._month);
            rpt.SetParameterValue("year", this._year);


            this.crystalReportViewer1.ReportSource = rpt;
        }

    }
}
